@extends('layouts.main')

@section('content')
<div class="card-header">
    <a href="{{ route('categories.create') }}" class="btn btn-primary">Добавить</a>
    <table id="example" class="table table-striped table-bordered" style="width:100%">
        <thead>
            <tr>
                <th>ID</th>
                <th>Наименование</th>
                
            </tr>
        </thead>
        <tbody>
        @foreach ($categories as $category)
            <tr>
                <td>{{ $category->id }}</td>
                <td><a href="{{route('categories.show', $category->id )}}">{{$category->title}}</a></td>
               
                @endforeach
            </tr>
        </tbody>
</div>

@endsection